<!DOCTYPE html>
<html>
<head>
    <title>js面向对象--继承(原型对象的问题)</title>
    <meta charset="utf-8"/>
    <script>
        function Person(){
        }

        Person.prototype = {
            constructor: Person,
            name: "GaoLei",
            age: 29,
            job: "Software",
            friends: ["Shelby", "Ji"],
            sayName: function(){
                alert(this.name);
            }
        };

        var per1 = new Person();
        var per2 = new Person();

        per1.friends.push("van");
        alert(per1.friends);
        alert(per2.friends);
        alert(per1.friends === per2.friends);
    </script>
</head>
<body>
</body>
</html>